Modding (Civ6)/How to Remove Base Game Content
There are two ways to remove the base game content: # Replace one of the game files with your version. This is not recommended, and it can cause issues with other mods that want to change stuff in the file. This method should only be used when you must replace one of the XML or Lua files in the UI. # Use SQLite or XML commands to manipulate the database values. This is the preferred and much simpler way to alter the game database, but you can't use it to change the UI. To replace a game file, you need to make a file with the same name and contents in your project, then make your changes. Then, you need to add an Import Files action to your mod, and add the file to that action. This will have the mod overwrite the base game file of the same name. To delete from the game database with SQLite, first make a new SQL file in your mod, and name it whatever you want. We will be using the following command: DELETE FROM Table WHERE (Column1=A or Column2=B); DELETE FROM Table defines the Table to change. All of the table names can be found in GameplaySchema.sql in Base\Assets\Gameplay\Data\Schema\, or you can look in the XML database files. If put on a semi-colon and just stopped here, our command would delete every row in the table! For example, the command DELETE FROM Buildings; ''' would remove all of the game buildings, so be careful. '''WHERE Column1=A; This part defines which rows will be deleted. Only the rows which have a value of A in the column 'Column1' will be deleted. You can delete from other rows as well by extending the expression: WHERE (Column1=A or Column2=B); ' adding as many 'or ColumnX=N' as you like. Lets remove the Missionary from the game. We need to find all of the tables that contain data about the missionary, and then delete from those tables. We do a search in the game files for tables that contain rows with 'UNIT_MISSIONARY'. '-- Units.xml DELETE FROM Types WHERE Type='UNIT_MISSIONARY'; DELETE FROM TypeTags WHERE Type='UNIT_MISSIONARY'; DELETE FROM Units WHERE UnitType='UNIT_MISSIONARY'; DELETE FROM Unit_BuildingPrereqs WHERE Unit='UNIT_MISSIONARY'; '-- UnitAbilities.xml' DELETE FROM TypeTags WHERE Tag='UNIT_MISSIONARY'; If we wanted to be extra thorough to make sure the game doesn't even try to implement modifiers or requirements having to do with missionaries, we can delete from modifier and requirement tables: '-- UnitAbilities.xml' DELETE FROM RequirementSetRequirements WHERE RequirementId='PLOT_UNIT_IS_MISSIONARY_REQUIREMENTS'; DELETE FROM Requirements WHERE RequirementId='PLOT_UNIT_IS_MISSIONARY_REQUIREMENTS'; DELETE FROM RequirementArguments WHERE RequirementId='PLOT_UNIT_IS_MISSIONARY_REQUIREMENTS'; '-- Beliefs.xml' DELETE FROM BeliefModifiers WHERE ModifierId='HOLY_ORDER_MISSIONARY_DISCOUNT'; DELETE FROM Modifiers WHERE ModifierId='HOLY_ORDER_MISSIONARY_DISCOUNT'; DELETE FROM Modifiers WHERE ModifierId='HOLY_ORDER_MISSIONARY_DISCOUNT_MODIFIER'; DELETE FROM ModifierArguments WHERE ModifierId='HOLY_ORDER_MISSIONARY_DISCOUNT'; DELETE FROM ModifierArguments WHERE ModifierId='HOLY_ORDER_MISSIONARY_DISCOUNT_MODIFIER'; Once we have saved our SQL file, we just need to add an UpdateDatabase action to our mod, then add our SQL file to that action. Tips: - String values in SQLite are defined with single quotes rather than double quotes. - Boolean (true or false) values in SQLite are handled with integer 0 and 1. - You can make a line into a comment in SQLite with two hyphens at the beginning -- Category:Modding (Civ6)